#include "imageitem.h"
#include <QPainter>

ImageItem::ImageItem(const QImage& image,const QRect& rect):
    m_image(image),
    m_rect(rect)
{
}

void ImageItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
    painter->drawImage(m_rect,m_image);
}

QRectF ImageItem::boundingRect() const
{
    if (m_image.isNull())
        return QRectF();
    return QRectF(QPointF(0.0,0.0), m_image.size());
}
